<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            height: 1200px;
        }
    </style>
</head>
<body>
    <input type="text" id="input">
    <script>
        var input = document.getElementById("input")
        // 输入框内容改变时触发
        input.onchange = function(){
            console.log("hello world");
        }
        // onresize 窗口大小改变的时候触发
        window.onresize = function(){
            console.log("窗口大小改变了");
        }
        // onscroll 窗口滚动时触发
        window.onscroll = function(){
            console.log(2);
        }
    </script>
</body>
</html>